<?php


//自定义常量目录
$is_cgi = (0 === strpos(PHP_SAPI, 'cgi') || false !== strpos(PHP_SAPI, 'fcgi')) ? 1 : 0;
$is_win = strstr(PHP_OS, 'WIN') ? 1 : 0;
if ($is_cgi) {

    $_temp = explode('.php', $_SERVER['PHP_SELF']);
    $temp_file = rtrim(str_replace($_SERVER['HTTP_HOST'], '', $_temp[0] . '.php'), '/');
} else {
    $temp_file = rtrim($_SERVER['SCRIPT_NAME'], '/');

}



$_root = rtrim(dirname($temp_file), '/');
$root = (($_root == '/' || $_root == '\\') ? '' : $_root);


define('_SKIN', $root . '/skin'); //主题
define('_STATIC', $root . '/static');//前端类库
unset($is_cgi, $is_win, $_temp, $temp_file, $_root, $root);


// 定义应用目录
define('APP_PATH', __DIR__ . '/app/');
// 加载框架引导文件
require __DIR__ . '/thinkphp/start.php';
